/**
 *
 * Copyright  2011 Nokia Corporation.
 * tuomo.hirvonen@digia.com
 *
 */



#ifndef __THEMENU__
#define __THEMENU__

class TheGame;

#ifdef Q_OS_SYMBIAN
#define MENU_RELATIVE_Y_CENTER 0.68f
#define MENU_Y_SPACING 1.6f
#define MENU_Y_SIZE 1.5f
#define BUTTON_TEXT_SIZE 40
#else
#define MENU_RELATIVE_Y_CENTER 0.7f
#define MENU_Y_SPACING 1.75f
#define MENU_Y_SIZE 1.7f
#define BUTTON_TEXT_SIZE 48
#endif


class TheMenu {
public:
    TheMenu( TheGame *game, const char *menuString[], const bool *activeItems = 0);
    ~TheMenu();


    void update( const float frameTime );
    void render();

        // Returns true if menu was hit, false otherwise
    bool mousedown( float x, float y);

        // Returns the index of the command if event caused a click
    int mouseup( float x, float y );

protected:
    float appearCounter;
    int coordToMenuIndex( float x, float y );
    void renderButton(  float x, float y, const char *text, bool pressed, bool active );
    TheGame *game;
    const char **currentStrings;
    const bool *activeItems;
    int itemCount;
    int activeItem;
};


#endif
